﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

class Testing
{
    static void Main(string[] args)
    {
        string text = "aaaa";
        Regex pattern = new Regex(@"aa");
        var matches = pattern.Matches(text);
        foreach (var match in matches)
        {
            Console.WriteLine(match);
        }
    }
}
